#!/usr/bin/env bash
gover=1.21.1
wget -c https://golang.google.cn/dl/go$gover.linux-amd64.tar.gz
tar zxvf go$gover.linux-amd64.tar.gz
mv go /usr/local
echo "export GOROOT=/usr/local/go">>/etc/profile
echo "export GOPATH=~/gopath">>/etc/profile
echo "export GOCACHE=~/gocache">>/etc/profile
echo "export PATH=$PATH:$GOROOT/bin:$GOPATH/bin:$GOCACHE/bin">>/etc/profile
source /etc/profile
/usr/local/go/bin/go env -w GO111MODULE=on
/usr/local/go/bin/go env -w GOPROXY=https://goproxy.cn,direct